package com.zyh.day02.value

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object SampleTest {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
      .setAppName("mp")
      .setMaster("local[*]")
    val sc = new SparkContext(conf)
    val rdd1: RDD[Int] = sc.makeRDD(1 to 1000,4)
    val rdd2: RDD[Int] = rdd1.sample(false,0.01)
    rdd2.collect().foreach(println)
    sc.stop()
  }
}
